* for e.g. older versions of libostree unaware of pinning to GC the deployment.
*
* This function does nothing and returns successfully if the deployment
- * is already in the desired pinning state.
+ * is already in the desired pinning state. It is an error to try to pin
+ * the staged deployment (as it's not in the bootloader entries).
*
* Since: 2018.3
*/
if (is_pinned == current_pin)
return TRUE;
+ if (ostree_deployment_is_staged (deployment))
+ return glnx_throw (error, "Cannot pin staged deployment");
+
g_autoptr(OstreeDeployment) deployment_clone = ostree_deployment_clone (deployment);
GKeyFile *origin_clone = ostree_deployment_get_origin (deployment_clone);
done
test -f deployment-ref-found
rm deployment-ref-found
+ if ostree admin pin 0 2>err.txt; then
+ echo "Pinned staged deployment"; exit 1
+ fi
+ grep -qFe 'Cannot pin staged deployment' err.txt
environment:
commit: "{{ rpmostree_status['deployments'][0]['checksum'] }}"
- include_tasks: ../tasks/reboot.yml